package com.yilin.platform.entity.cmbc;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.platform.base_core.application.BaseEntity;
import com.yilin.platform.base_core.application.CapitalBaseEntity;
import com.yilin.platform.base_core.application.FlowField;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "cmbc_trade_record")
@TableName(value = "cmbc_trade_record")
public class CmbcTradeRecord extends CapitalBaseEntity {

    public enum Status {
        create(0, "创建"),
        handle(1, "处理中"),
        success(2, "交易成功"),
        closes(3, "交易关闭"),
        fail(4, "交易失败");
        @EnumValue
        public Integer index;
        public String name;

        Status(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }
    public enum PayType {
        transfer (0, "单笔转账"),
        batchTransfer (1, "批量转账"),
        batchBehalf (2, "批量，费用报销，代发工资");
        @EnumValue
        public Integer index;
        public String name;

        PayType(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    @Column(name = "remark")
    private String remark;//备注
    @Column(name = "trade_name")
    private String tradeName;//交易名称
    @Column(name = "batch_no")
    private String batchNo;//批次单号//单笔禁填
    @Column(name = "status")
    private Status status;//支付状态


    @Column(name = "next_wait_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date nextWaitTime = new Date();//交易处理中的下次查询时间
    @Column(name = "query_wait_count")
    private Integer queryWaitCount = 0;//查询次数
    @Column(name = "pay_type")
    private PayType payType;//支付状态


    //-----------------------其他字段---------------------------
    @Transient
    @TableField(exist = false)
    private String externBank;//（★）是否跨行 本行：0 跨行：1
    @Transient
    @TableField(exist = false)
    private String localFlag;//（★）汇路
    @Transient
    @TableField(exist = false)
    private String rcvCustType;//收款人账户类型：对公；对私；
    @Transient
    @TableField(exist = false)
    private String bankCode;//收款人开户行行号
    @Transient
    @TableField(exist = false)
    private String bankName;//收款人开户行名称（★）(大/小额、网银互联汇 路此项必填)
    @Transient
    @TableField(exist = false)
    private String bankAddr;//收款人开户行地址(可选)
    @Transient
    @TableField(exist = false)
    private String areaCode;//收款行地区编号(可选)
    @Transient
    @TableField(exist = false)
    private String explain;//跨行公转私，需输入常用用途代码
    @Transient
    @TableField(exist = false)
    private String certNo;//企业自制凭证号(8位以内的数字)

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getTradeName() {
        return tradeName;
    }

    public void setTradeName(String tradeName) {
        this.tradeName = tradeName;
    }

    public String getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public Date getNextWaitTime() {
        return nextWaitTime;
    }

    public void setNextWaitTime(Date nextWaitTime) {
        this.nextWaitTime = nextWaitTime;
    }

    public Integer getQueryWaitCount() {
        return queryWaitCount;
    }

    public void setQueryWaitCount(Integer queryWaitCount) {
        this.queryWaitCount = queryWaitCount;
    }

    public PayType getPayType() {
        return payType;
    }

    public void setPayType(PayType payType) {
        this.payType = payType;
    }


    public String getExternBank() {
        return externBank;
    }

    public void setExternBank(String externBank) {
        this.externBank = externBank;
    }

    public String getLocalFlag() {
        return localFlag;
    }

    public void setLocalFlag(String localFlag) {
        this.localFlag = localFlag;
    }

    public String getRcvCustType() {
        return rcvCustType;
    }

    public void setRcvCustType(String rcvCustType) {
        this.rcvCustType = rcvCustType;
    }

    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getBankAddr() {
        return bankAddr;
    }

    public void setBankAddr(String bankAddr) {
        this.bankAddr = bankAddr;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getExplain() {
        return explain;
    }

    public void setExplain(String explain) {
        this.explain = explain;
    }

    public String getCertNo() {
        return certNo;
    }

    public void setCertNo(String certNo) {
        this.certNo = certNo;
    }
}
